<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcCms.Web.ViewModels.BackOfficeModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    MvcCms -
    <%=ViewData["PageTitle"]%>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class="contentpage-outerdiv">
    <h2>
        <%=ViewData["PageTitle"]%></h2>
    <table cellpadding="5" cellspacing="5">
        <tr>
            <td>
                <table border="0" cellpadding="0" cellspacing="0" class="data-table">
                    <%
                        foreach (var cat in Model._ContentCategories)
                        {%>
                    <tr>
                        <td>
                            <%if (cat.CategoryID == Model._ContentCategory.CategoryID)
                              { %>
                            <%=Html.ActionLink(cat.Title, "setpublishedpage", new { id = cat.CategoryID }, new { @class = "active" })%>
                            <%}
                              else
                              { %>
                            <%=Html.ActionLink(cat.Title, "setpublishedpage", new { id = cat.CategoryID })%>
                            <%} %>
                        </td>
                    </tr>
                    <%}
                    %>
                </table>
            </td>
            <td>
                &nbsp;
            </td>
            <td valign="top">
                <% using (Html.BeginForm())
                   {%>
                <table border="0" cellpadding="0" cellspacing="0" class="data-table">
                    <tr>
                        <th colspan="2">
                            Category:
                            <%=ViewData["currentcat"].ToString() %>
                        </th>
                    </tr>
                    <tr>
                        <th>
                            Page Name
                        </th>
                        <th>
                            Is Published Version
                        </th>
                    </tr>
                    <%
                        foreach (var contentPage in Model._ContentPages)
                        {
                            var isPublished = contentPage.IsCategoryPage;
                        %>
                        <tr>
                            <td>
                            <%
                            if (!isPublished)
                            {
                            %>
                                <%=Html.ActionLink("Preview", "PreviewUnPublished", "Home", new { contentPageID = contentPage.ContentPageID }, null)%>
                            <%
                            }
                            %>
                            <%=contentPage.Title%>
                            </td>
                            <td>
                                <%=Html.RadioButton("selectedpageId", contentPage.ContentPageID, isPublished)%>
                            </td>
                        </tr>
                    <%}
                    %>
                </table>
                <p>
                    <input type="submit" value="Save" />
                </p>
                <% } %>
            </td>
        </tr>
    </table>
</div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ScriptContent" runat="server">
</asp:Content>
